var pageii = null;
var grid = null;
$(function() {
	grid = lyGrid({
		pagId : 'paging',
		l_column : [{
			colkey : "checkDate",
			name : "日期",
			renderData : function(rowindex,data, rowdata, column) {
				if(data!=''){
					return new Date(data).format("yyyy-MM-dd");
				}else{
					return "";
				}
			}
		}, {
			colkey : "iSchedule",
			name : "班组",
			renderData : function(rowindex,data, rowdata, column) {
				if (data==1 || data=="1"){
					return "甲班";
				}else if (data==2 || data=="2"){
					return "乙班";
				}else{
					return "";
				}
			}
		}, {
			colkey : "",
			name : "机台号？？？"
		}, {
			colkey : "uninstallNo",
			name : "拆模编号"
		}, {
			colkey : "mold_encode",
			name : "装模编号"
		}, {
			colkey : "enoughTime",
			name : "够产停机时间"
		}, {
			colkey : "uBeginTime",
			name : "开始换模时间"
		}, {
			colkey : "endCheck",
			name : "完成时间"
		}, {
			colkey : "loadTotalTime",
			name : "总耗时",
			renderData : function(rowindex,data, rowdata, column) {
				if(data!=''){
					return data+"分钟";
				}else{
					return "";
				}
			}
		}, {
			colkey : "judge",
			name : "合格判定",
			renderData : function(rowindex,data, rowdata, column) {
				if (data==1 || data=="1"){
					return "合格";
				}else if (data==2 || data=="2"){
					return "不合格";
				}
			}
		}, {
			colkey : "reworkDescription",
			name : "返工问题描述"
		}, {
			colkey : "adjustPeople",
			name : "调机员"
		}],
		jsonUrl : rootPath + '/installd/overtimeReport_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});
	$("#editFun").click("click", function() {
		editAccount();
	});
	$("#search").click("click", function() {
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
		});
	});
});
function editAccount() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	pageii = layer.open({
		title : "编辑超时装模统计表",
		type : 2,
		area : [ "800px", "100%" ],
		content : rootPath + '/installd/overtimeReport_edit.shtml?id=' + cbox
	});
}




